import { sys, root } from '@/api/apiRoot';
import { defHttp } from '@/utils/http';
import type { IQuery, IResData } from '@/api/indexTypes';
import type {
  MemberApplyFormDetailsResult,
  IMemberManageListData,
  IMemberManageListResData,
  ISettingInfoResData,
  IUpdateSettingInfoData,
  MemberApplyFormReviewData,
  MemberInfoApplyDetailsResult,
  IAddMemberData,
  ILeadingMemberListData,
  ILeadingMemberListResData,
  AdminMemberInfoResult,
  ILeadingMemberAddData,
  IPaymentRecordListResData,
  IPaymentRecordInfoResData,
  IMemberApplyPaymentData,
  IApplyTemplateListResData,
  PotentialClientPageListResult,
  PotentialClientRecordListResult,
  PotentialClientRecordPageListData,
  PotentialClientRecordPageListResult,
  ICreatePaymenrecordData,
  IPayFeesReviewData,
  IMemberApplyByIdResult,
  IPaymentRecordExportData,
  IRenewOfflineMemberOrderListResult,
  IRenewCreatePaymenrecordData,
  IPaymenrecordByIdResult,
  ContactsReviewListResult,
  ContactsDetailResult,
  ReviewData,
  AttachmentAddData,
  AttachmentListResult,
  PhotosData,
  EditPhotosGroupData,
  BatchUpImageData,
  MsgUserData,
  CreateMsgData,
  SearchUserData,
  MessageDetailData,
  SearchResultData,
  SysMemberPageListData,
  SysMemberPageListResult,
  SysAuditStatisticsResult,
  SysMemberAuditStatisticsResult,
  SysConnectionAuditStatisticsResult,
  IFormParame,
} from './types';
import type { MemberApplyResult } from '../membership/types';
import type { PersonalCardDetailsResult } from '../card/types';
import type { UnitAddData, UnitListResult } from '../mine/types';
import type { PaymentStatusEnum } from '@/enums/membershipEnum';

export const Api = {
  /** 入会资料审核相关 */
  memberApplyFormList: sys + 'member-apply-form/getPageList',
  memberApplyFormDetails: sys + 'member-apply-form/details',
  memberApplyFormReview: sys + 'member-apply-form/review',
  memberApplyPayment: sys + 'member-apply-form/paymentMember',
  /** 资料变更审核相关 */
  memberInfoApplyList: sys + 'member-info-apply/getPageList',
  memberInfoApplyDetails: sys + 'member-info-apply/getApplyInfo',
  memberInfoApplyReview: sys + 'member-info-apply/review',

  /** 会员管理列表 */
  memberManageList: sys + 'member/memberList',
  /** 会员设置信息 */
  settingInfo: sys + 'member/getByIdSettingInfo/',
  /** 修改会员设置 */
  updateSettingInfo: sys + 'member/updateByIdSettingInfo',
  /** 添加会员 */
  addMember: sys + 'member/addMember',
  /** 获取入会模板 */
  applyTemplateList: root + 'member-apply-form/getApplyTemplateList',

  /** 成员列表 */
  leadingMemberList: sys + 'LeadingMember/pageList',
  /** 成员添加 */
  leadingMemberAdd: sys + 'LeadingMember/add',
  /** 成员修改 */
  leadingMemberEdit: sys + 'LeadingMember/update',
  /** 成员删除 */
  leadingMemberDel: sys + 'LeadingMember/delete/',
  /** 成员信息 */
  leadingMemberInfo: sys + 'LeadingMember/info/',

  /** 入会信息 */
  adminMemberInfo: sys + 'member/getMemberInfo',
  adminUpdateMemberInfo: sys + 'member/updateMemberInfo',
  memberCertificate: sys + 'member/getMemberCertificate',

  /** 缴费信息 */
  paymentRecordList: sys + 'payment_record/pageList',
  paymentRecordInfo: sys + 'payment_record/getInfo/',
  paymentExport: sys + 'payment_record/paymentExport/',
  mafPaymentExport: sys + 'member-apply-form/paymentExport/',

  /** 意向会员相关 */
  potentialClientPageList: sys + 'member/potentialClient/pageList',
  potentialClientRecordList: sys + 'member/potentialClientRecord/list',
  potentialClientRecordPageList: sys + 'member/potentialClientRecord/pageList',
  cardInfoSync: sys + 'member/cover',

  /** 入会缴费相关 */
  createPaymenrecord: sys + 'member-paymenrecord/payFees/createPaymenrecord',
  memberApplyById: sys + 'member-paymenrecord/payFees/getMemberApplyById/',
  payFeesReview: sys + 'member-paymenrecord/payFees/review',
  paymentRecordExport: sys + 'member-paymenrecord/paymentExport',

  /** 会员续费 */
  renewOfflineMemberOrderList: sys + 'member-paymenrecord/renew/renewOfflineMemberOrderList',
  paymenrecordById: sys + 'member-paymenrecord/getById/',
  renewReview: sys + 'member-paymenrecord/renew/review',
  renewCreatePaymenrecord: sys + 'member-paymenrecord/renew/createPaymenrecord',
  renewExport: sys + 'member-paymenrecord/renewExport',
  renewDataInfo: sys + 'member-paymenrecord/renew/getRenewDataInfo/',

  /** 人脉审核相关 */
  contactsReviewList: sys + 'member-contacts-unlock-record/page',
  contactsReview: sys + 'member-contacts-unlock-record/review',
  cooperationList: sys + 'member-contacts-unlock-record/cooperation/page',
  cooperationReview: sys + 'member-contacts-unlock-record/cooperation/review',
  contactsDetail: sys + 'member-contacts-unlock-record/getById/',
  membershipFormPdf: sys + 'member/customPdf',
  /** 附件管理相关 */
  attachmentList: sys + 'headquarters-member-accessory/pageList',
  attachmentAdd: sys + 'headquarters-member-accessory/add',
  attachmentDel: sys + 'headquarters-member-accessory/del',

  // 相册管理相关
  addPhotoAlbum: root + 'photoAlbum/add',
  modifyPhotoAlbum: root + 'photoAlbum/modify',
  forceDelPhotoAlbum: root + 'photoAlbum/forceDel',
  topPhotoAlbum: root + 'photoAlbum/top',
  removeTopPhotoAlbum: root + 'photoAlbum/removeTop',
  photoAlbumDetails: root + 'photoAlbum/details',
  // 相册分组相关
  addPhotoAlbumGroup: root + 'photoAlbumGroup/add',
  modifyPhotoAlbumGroup: root + 'photoAlbumGroup/modify',
  forceDelPhotoAlbumGroup: root + 'photoAlbumGroup/forceDel',
  // 相册详情操作相关
  addBatchPhoto: root + 'photo/addBatch',
  delBatchPhoto: root + 'photo/delBatch',
  // 消息相关
  getMessageTypeList: sys + 'messageRecord/getTreeDownList',
  getSMSTemplatePlaceholderVo: sys + 'messageRecord/getSMSTemplatePlaceholderVo',
  getSMSTemplate: sys + 'messageRecord/getList',
  getWXTemplate: sys + 'messageRecord/wechatTemplate/listByTypeId',
  createdMessage: sys + 'messageRecord/add',
  messageRecordList: sys + 'messageRecord/messageRecordList',
  messageSendResult: sys + 'messageRecord/messageRecipient/list',
  // 消息-选择人员相关
  getMemberList: sys + 'messageRecord/getMemberInfoSearchVoList',
  getMemberStatistics: sys + 'messageRecord/getMemberInfoStatisticsVo',
  // 短信余量
  getSmsFindBalance: sys + 'messageRecord/findBalance',
  // 获取消息模板内容和标题
  getTypeMessageTemplate: sys + 'messageRecord/getTypeMessageTemplate',
  // 获取消息类型详情
  getTemplateTypeById: sys + 'messageRecord/getTemplateTypeById',
  // 获取自定义消息内容和标题
  getCustomePageContent: root + 'messageRead/findCustomePage',
  // 管理员获取指定人的个人名片详情
  sysPersonal: root + 'businessCard/sys/personal',
  // 管理员获取指定人的单位列表
  sysUnitList: sys + 'companies/user/list',
  // 管理员给指定人添加单位
  sysUnitAdd: sys + 'companies/add',
  // 管理员给指定人编辑单位
  sysUnitEdit: sys + 'companies/edit',
  // 缴费管理列表
  sysMemberPageList: sys + 'member-paymenrecord/memberPageList',
  // 个人中心统计数据
  sysAuditStatistics: sys + 'member/statistics/getSysAuditStatistics',
  /** 会员审核 统计数据 */
  sysMemberAuditStatistics: sys + 'member/statistics/getMemberAuditStatistics',
  /** 人脉审核 统计数据 */
  sysConnectionAuditStatistics: sys + 'member/statistics/getConnectionAuditStatistics',
};

/**
 * @description 获取入会审核列表
 * @date 21/10/2022
 * @export
 * @param {IQuery} data
 */
export function memberApplyFormList(data: IFormParame & IQuery) {
  return defHttp.post({
    url: Api.memberApplyFormList,
    data,
  });
}

/**
 * @description 获取入会审核详情
 * @date 21/10/2022
 * @export
 * @param {number} id
 */
export function memberApplyFormDetails(id: number) {
  return defHttp.get<MemberApplyFormDetailsResult>({
    url: Api.memberApplyFormDetails + `/${id}`,
  });
}

/**
 * @description 入会审核 - 提交审核
 * @date 25/10/2022
 * @export
 * @param {MemberApplyFormReviewData} data
 */
export function memberApplyFormReview(data: MemberApplyFormReviewData) {
  return defHttp.post<MemberApplyFormDetailsResult>({
    url: Api.memberApplyFormReview,
    data,
  });
}

/**
 * @description 获取资料变更审核列表
 * @date 21/10/2022
 * @export
 * @param {IQuery} data
 */
export function memberInfoApplyList(data: IFormParame & IQuery) {
  return defHttp.post({
    url: Api.memberInfoApplyList,
    data,
  });
}

/**
 * @description 资料变更审核详情
 * @date 25/10/2022
 * @export
 * @param {number} id
 */
export function memberInfoApplyDetails(id: number) {
  return defHttp.get<MemberInfoApplyDetailsResult>({
    url: Api.memberInfoApplyDetails + `/${id}`,
  });
}

/**
 * @description 资料变更审核 - 提交审核
 * @date 25/10/2022
 * @export
 * @param {MemberApplyFormReviewData} data
 */
export function memberInfoApplyReview(data: MemberApplyFormReviewData) {
  return defHttp.post({
    url: Api.memberInfoApplyReview,
    data,
  });
}

/**
 * 会员管理列表
 * @export
 * @return {*}  {Promise<any>}
 */
export function memberManageList(
  data: IMemberManageListData,
): Promise<IResData<IMemberManageListResData>> {
  const { current, size, ...last } = data;
  return defHttp.post({
    url: Api.memberManageList, // + `?current=${current}&size=${size}`
    data: { current, size, ...last },
  });
}

/**
 * @description 获取会员设置信息
 * @date 21/10/2022
 * @export
 * @param id
 */
export function settingInfo(id: number): Promise<ISettingInfoResData> {
  return defHttp.get({
    url: Api.settingInfo + id,
  });
}

/**
 * @description 获取会员设置信息
 * @date 21/10/2022
 * @export
 * @param data
 */
export function updateSettingInfo(data: IUpdateSettingInfoData) {
  return defHttp.post({
    url: Api.updateSettingInfo,
    data,
  });
}

/**
 * @description 添加会员信息
 * @date 21/10/2022
 * @export
 * @param data
 */
export function addMember(data: IAddMemberData) {
  return defHttp.post({
    url: Api.addMember,
    data,
  });
}

/**
 * @description 获取模板列表
 * @date 21/10/2022
 * @export
 * @param
 */
export function applyTemplateList() {
  return defHttp.get<IApplyTemplateListResData[]>({
    url: Api.applyTemplateList,
  });
}

/**
 * @description 成员列表
 * @date 21/10/2022
 * @export
 * @param data
 */
export function leadingMemberList(
  data: ILeadingMemberListData,
): Promise<IResData<ILeadingMemberListResData>> {
  return defHttp.get({
    url: Api.leadingMemberList,
    data,
  });
}

/**
 * @description 成员新增
 * @date 21/10/2022
 * @export
 * @param data
 */
export function leadingMemberAdd(data: ILeadingMemberAddData) {
  return defHttp.post({
    url: Api.leadingMemberAdd,
    data,
  });
}

/**
 * @description 成员修改
 * @date 21/10/2022
 * @export
 * @param data
 */
export function leadingMemberEdit(data: ILeadingMemberAddData) {
  return defHttp.post({
    url: Api.leadingMemberEdit,
    data,
  });
}

/**
 * @description 成员删除
 * @date 21/10/2022
 * @export
 * @param id
 */
export function leadingMemberDel(id: number) {
  return defHttp.post({
    url: Api.leadingMemberDel + id,
  });
}

/**
 * @description 成员删除
 * @date 21/10/2022
 * @export
 * @param id
 */
export function leadingMemberInfo(id: number) {
  return defHttp.get({
    url: Api.leadingMemberInfo + id,
  });
}

/**
 * @description 管理员 - 入会信息
 * @date 25/10/2022
 * @export
 * @param {number} id
 */
export function adminMemberInfo(id: number) {
  return defHttp.get<AdminMemberInfoResult>({
    url: Api.adminMemberInfo + `/${id}`,
  });
}

/**
 * @description 管理员 - 提交入会信息
 * @date 25/10/2022
 * @export
 * @param {*} data
 */
export function adminUpdateMemberInfo(data: any) {
  return defHttp.post({
    url: Api.adminUpdateMemberInfo,
    data,
  });
}

export function memberCertificate(id: number) {
  return defHttp.get<MemberApplyResult>({
    url: Api.memberCertificate + `/${id}`,
  });
}

/**
 * @description 管理员 - 缴费记录
 * @date 26/10/2022
 * @export
 * @param {*} data
 */
export function paymentRecordList(data: any): Promise<IResData<IPaymentRecordListResData>> {
  return defHttp.get({
    url: Api.paymentRecordList,
    data,
  });
}

export function paymentRecordInfo(id: number): Promise<IPaymentRecordInfoResData> {
  return defHttp.get({
    url: Api.paymentRecordInfo + id,
  });
}

export function memberApplyPayment(data: IMemberApplyPaymentData) {
  return defHttp.post<{ memberId: number }>({
    url: Api.memberApplyPayment,
    data,
  });
}

/**
 * @description 获取意向会员列表
 * @date 17/11/2022
 * @export
 */
export function potentialClientPageList(data: IQuery) {
  return defHttp.get<IResData<PotentialClientPageListResult>>({
    url: Api.potentialClientPageList,
    data,
  });
}

/**
 * @description 意向会员 - 查询类型列表
 * @date 17/11/2022
 * @export
 * @param {number} appUserId
 */
export function potentialClientRecordList(appUserId: number) {
  return defHttp.get<PotentialClientRecordListResult[]>({
    url: Api.potentialClientRecordList,
    data: { appUserId },
  });
}

/**
 * @description 意向会员 - 访问记录
 * @date 17/11/2022
 * @export
 * @param {PotentialClientRecordPageListData} data
 */
export function potentialClientRecordPageList(data: PotentialClientRecordPageListData) {
  return defHttp.get<IResData<PotentialClientRecordPageListResult>>({
    url: Api.potentialClientRecordPageList,
    data,
  });
}

/**
 * @description 手动同步入会信息到名片
 * @date 23/03/2023
 * @export
 * @param {number} cocId
 * @param {number} leaderId
 */
export function cardInfoSync(cocId: number, leaderId: number) {
  return defHttp.get({
    url: Api.cardInfoSync,
    data: {
      cocId,
      leaderId,
    },
  });
}
/**
 * @description 入会缴费 - 创建会费订单
 * @date
 * @export
 * @param {ICreatePaymenrecordData} data
 */
export function CreatePaymenrecord(data: ICreatePaymenrecordData) {
  return defHttp.post({
    url: Api.createPaymenrecord,
    data,
  });
}

/**
 * @description 入会缴费 - 获取缴费订单详情
 * @date
 * @export
 * @param
 */
export function MemberApplyById(id: number) {
  return defHttp.get<IMemberApplyByIdResult>({
    url: Api.memberApplyById + id,
  });
}

/**
 * @description 入会缴费 - 缴费审核
 * @date
 * @export
 * @param
 */
export function PayFeesReview(data: IPayFeesReviewData) {
  return defHttp.post({
    url: Api.payFeesReview,
    data,
  });
}

/**
 * @description 会员审核 - 续费审核列表
 * @date
 * @export
 * @param
 */
export function RenewOfflineMemberOrderList(data: IQuery) {
  return defHttp.get<IRenewOfflineMemberOrderListResult[]>({
    url: Api.renewOfflineMemberOrderList,
    data,
  });
}

/**
 * @description 续费详情
 * @date
 * @export
 * @param
 */
export function PaymenrecordById(id: number) {
  return defHttp.get<IPaymenrecordByIdResult>({
    url: Api.paymenrecordById + id,
  });
}

/**
 * @description 续费审核
 * @date
 * @export
 * @param
 */
export function RenewReview(data: IPayFeesReviewData) {
  return defHttp.post({
    url: Api.renewReview,
    data,
  });
}

/**
 * @description 创建续费订单
 * @date
 * @export
 * @param
 */
export function RenewCreatePaymenrecord(data: IRenewCreatePaymenrecordData) {
  return defHttp.post({
    url: Api.renewCreatePaymenrecord,
    data,
  });
}

/**
 * @description 根据会员id查询待续费订单
 * @date
 * @export
 * @param
 */
export function RenewDataInfo(id: number) {
  return defHttp.get({
    url: Api.renewDataInfo + id,
  });
}

/**
 * @description 会内人脉审核列表
 * @date 28/02/2023
 * @export
 * @param {IQuery} data
 */
export function contactsReviewList(data: { orderState: number } & IQuery) {
  return defHttp.get<IResData<ContactsReviewListResult>>({
    url: Api.contactsReviewList,
    data,
  });
}

/**
 * @description 会外人脉审核列表
 * @date 28/02/2023
 * @export
 * @param {IQuery} data
 */
export function cooperationList(data: { orderState: number } & IQuery) {
  return defHttp.get<IResData<ContactsReviewListResult>>({
    url: Api.cooperationList,
    data,
  });
}

/**
 * @description 人脉详情
 * @date 28/02/2023
 * @export
 * @param {IQuery} id
 */
export function contactsDetail(id: number) {
  return defHttp.get<ContactsDetailResult>({
    url: Api.contactsDetail + id,
  });
}

/**
 * @description 本会人脉审核
 * @date 28/02/2023
 * @export
 * @param {IQuery} data
 */
export function contactsReview(data: ReviewData) {
  return defHttp.post({
    url: Api.contactsReview,
    data,
  });
}

/**
 * @description 合作人脉审核
 * @date 28/02/2023
 * @export
 * @param {IQuery} data
 */
export function cooperationReview(data: ReviewData) {
  return defHttp.post({
    url: Api.cooperationReview,
    data,
  });
}

/**
 * @description 附件列表
 * @date 08/05/2023
 * @export
 * @param {(IQuery & { memberId: number })} data
 */
export function attachmentList(data: IQuery & { memberId: number }) {
  return defHttp.get<IResData<AttachmentListResult>>({
    url: Api.attachmentList,
    data
  })
}

/**
 * @description 添加附件
 * @date 08/05/2023
 * @export
 * @param {AttachmentAddData} data
 */
export function attachmentAdd(data: AttachmentAddData) {
  return defHttp.post({
    url: Api.attachmentAdd,
    data
  })
}

/**
 * @description 删除附件
 * @date 08/05/2023
 * @export
 * @param {number} id 附件id
 */
export function attachmentDel(id: number) {
  return defHttp.post({
    url: Api.attachmentDel + `/${id}`,
  })
}

/**
 * @description 新建相册
 * @date 09/05/2023
 * @export
 * @param {PhotosData} data
 */
export function addPhotoAlbum(data: PhotosData) {
  return defHttp.post({
    url: Api.addPhotoAlbum,
    data
  })
}

/**
 * @description 编辑相册
 * @date 09/05/2023
 * @export
 * @param {PhotosData} data
 */
export function modifyPhotoAlbum(data: PhotosData) {
  return defHttp.post({
    url: Api.modifyPhotoAlbum,
    data
  })
}

/**
 * @description 删除相册
 * @date 09/05/2023
 * @export
 * @param {number} id
 */
export function forceDelPhotoAlbum(id: number) {
  return defHttp.get({
    url: Api.forceDelPhotoAlbum + `/${id}`
  })
}

/**
 * @description 置顶相册
 * @date 09/05/2023
 * @export
 * @param {number} id
 */
export function topPhotoAlbum(id: number) {
  return defHttp.get({
    url: Api.topPhotoAlbum + `/${id}`
  })
}

/**
 * @description 取消置顶相册
 * @date 09/05/2023
 * @export
 * @param {number} id
 */
export function removeTopPhotoAlbum(id: number) {
  return defHttp.get({
    url: Api.removeTopPhotoAlbum + `/${id}`
  })
}

/**
 * @description 获取相册详情
 * @date 09/05/2023
 * @export
 * @param {number} id
 */
export function photoAlbumDetails(id: number) {
  return defHttp.get({
    url: Api.photoAlbumDetails + `/${id}`
  })
}

/**
 * @description 新增相册分组列表
 * @date 10/05/2023
 * @export
 * @param {EditPhotosGroupData} data
 */
export function addPhotoAlbumGroup(data: EditPhotosGroupData) {
  return defHttp.post({
    url: Api.addPhotoAlbumGroup,
    data
  })
}

/**
 * @description 修改相册分组
 * @date 10/05/2023
 * @export
 * @param {EditPhotosGroupData} data
 */
export function modifyPhotoAlbumGroup(data: EditPhotosGroupData) {
  return defHttp.post({
    url: Api.modifyPhotoAlbumGroup,
    data
  })
}

/**
 * @description 删除相册分组
 * @date 10/05/2023
 * @export
 * @param {number} id
 */
export function forceDelPhotoAlbumGroup(id: number) {
  return defHttp.get({
    url: Api.forceDelPhotoAlbumGroup + `/${id}`
  })
}

/**
 * @description 相册详情-批量添加照片
 * @date 11/05/2023
 * @export
 * @param {BatchUpImageData[]} data
 */
export function addBatchPhoto(data: BatchUpImageData[]) {
  return defHttp.post({
    url: Api.addBatchPhoto,
    data
  })
}

/**
 * @description 相册详情-批量删除照片
 * @date 11/05/2023
 * @export
 * @param {number[]} data
 */
export function delBatchPhoto(data: number[]) {
  return defHttp.post({
    url: Api.delBatchPhoto,
    data
  })
}

/**
 * @description 获取消息类型列表
 * @date 17/05/2023
 * @export
 */
export function getMessageTypeList(data: { dataSource: string }) {
  return defHttp.get({
    url: Api.getMessageTypeList + `?dataSource=${data.dataSource}`
  })
}

/**
 * @description 获取关联内容列表
 * @date 17/05/2023
 * @export
 * @param {string} type 消息类型中的associatedObjects字段
 */
export function getSMSTemplatePlaceholderVo(type: string) {
  return defHttp.get({
    url: Api.getSMSTemplatePlaceholderVo + `?type=${type}`
  })
}

/**
 * @description 获取短信模版列表
 * @date 17/05/2023
 * @export
 * @param {number} id
 */
export function getSMSTemplate(id: number) {
  return defHttp.get({
    url: Api.getSMSTemplate + `?smsTemplateTypeId=${id}`
  })
}

/**
 * @description 获取微信模版列表
 * @date 23/05/2023
 * @export
 * @param {number} id
 */
export function getWXTemplate(id: number) {
  return defHttp.get({
    url: Api.getWXTemplate + `?typeId=${id}`
  })
}

/**
 * @description 获取用户列表
 * @date 17/05/2023
 * @export
 * @param {SearchUserData} data
 */
export function getMemberList(data: SearchUserData) {
  return defHttp.post<IResData<MsgUserData>>({
    url: Api.getMemberList,
    data
  })
}

/**
 * @description 获取用户总数统计列表
 * @date 17/05/2023
 * @export
 * userIds 指定用户发送时必传,逗号分割
 */
export function getMemberStatistics(data: { dataSource: string, objectId?: number, userIds?: string }) {
  return defHttp.get<{ personNumber: number, companyNumber: number }>({
    url: Api.getMemberStatistics + `?dataSource=${data.dataSource}&objectId=${data.objectId ?? ''}&userIds=${data.userIds ?? ''}`,
  })
}

/**
 * @description 创建消息
 * @date 18/05/2023
 * @export
 * @param {CreateMsgData} data
 */
export function createdMessage(data: CreateMsgData) {
  return defHttp.post({
    url: Api.createdMessage,
    data
  })
}

/**
 * @description 消息列表
 * @date 18/05/2023
 * @export
 * @param {IQuery} data
 */
export function getMsgSendList(data: IQuery) {
  return defHttp.get<IResData<MessageDetailData>>({
    url: Api.messageRecordList,
    data
  })
}

/**
 * @description 消息结果列表
 * @date 18/05/2023
 * @export
 * @param {SearchResultData} data
 */
export function getMessageSendResult(data: SearchResultData) {
  return defHttp.get({
    url: Api.messageSendResult,
    data
  })
}

/**
 * @description 获取短信余量
 * @date 22/05/2023
 * @export
 */
export function getSmsFindBalance() {
  return defHttp.get({
    url: Api.getSmsFindBalance
  })
}

/**
 * @description 获取消息模板内容和名称-消息详情用
 * @date 22/05/2023
 * @export
 * @param { any } data // 消息结果列表取值 messageChannelList
 */
export function getTypeMessageTemplate(data: any) {
  return defHttp.post({
    url: Api.getTypeMessageTemplate,
    data
  })
}

/**
 * @description 获取消息类型详情
 * @date 23/05/2023
 * @export
 * @param { id } id
 */
export function getTemplateTypeById(id: number) {
  return defHttp.get({
    url: Api.getTemplateTypeById + `/${id}`
  })
}

/**
 * @description 获取自定义页面内容
 * @date 25/05/2023
 * @export
 * @param { string } id
 */
export function getCustomePageContent(id: string) {
  return defHttp.get({
    url: Api.getCustomePageContent + `?readId=${id}`
  })
}

/**
 * @description 管理员获取指定人的个人名片
 * @date 21/07/2023
 * @export
 * @param {number} userId
 */
export function sysPersonalDetails(userId: number) {
  return defHttp.get<PersonalCardDetailsResult>({
    url: Api.sysPersonal + `/${userId}`,
  });
}

/** 管理员获取指定人的单位列表
 * @description
 * @date 28/07/2023
 * @export
 */
export function sysUnitList(userId: number) {
  return defHttp.get<UnitListResult[]>({
    url: Api.sysUnitList + `/${userId}`
  })
}

/**
 * @description 管理员给指定人添加单位
 * @date 06/07/2023
 * @export
 * @param {UnitAddData} data
 */
export function sysUnitAdd(data: { appUserInfoId: number } & UnitAddData) {
  return defHttp.post({
    url: Api.sysUnitAdd,
    data
  })
}

/**
 * @description 管理员给指定人编辑单位
 * @date 07/07/2023
 * @export
 * @param {({ id: number } & UnitAddData)} data
 */
export function sysUnitEdit(data: { id: number, appUserInfoId: number } & UnitAddData) {
  return defHttp.post({
    url: Api.sysUnitEdit,
    data
  })
}

/**
 * @description 缴费管理列表
 * @date 14/08/2023
 * @export
 * @param {SysMemberPageListData} data
 */
export function sysMemberPageList(data: SysMemberPageListData) {
  return defHttp.post<SysMemberPageListResult>({
    url: Api.sysMemberPageList,
    data
  })
}

/**
 * @description 个人中心 统计数据
 * @date 15/08/2023
 * @export
 */
export function sysAuditStatistics() {
  return defHttp.get<SysAuditStatisticsResult>({
    url: Api.sysAuditStatistics
  })
}

/**
 * @description 会员审核 统计数据
 * @date 15/08/2023
 * @export
 */
export function sysMemberAuditStatistics() {
  return defHttp.get<SysMemberAuditStatisticsResult>({
    url: Api.sysMemberAuditStatistics
  })
}

/**
 * @description 人脉审核 统计数据
 * @date 15/08/2023
 * @export
 */
export function sysConnectionAuditStatistics() {
  return defHttp.get<SysConnectionAuditStatisticsResult>({
    url: Api.sysConnectionAuditStatistics
  })
}